package com.duobaoyu.dby.supply.biz.enums;

import com.duobaoyu.dby.channel.adapter.enums.biz.refund.AfterSaleStatusEnum;
import com.duobaoyu.dby.common.mybatis.util.EnumUtils;
import lombok.Getter;

/**
 * @author yw
 * @description
 * @date 2023/10/19 09:56
 */
public enum AfterSaleStateLogEnum {
	AFTER_SALE_SUBMIT(AfterSaleStatusEnum.WAIT_DBY_AUDIT, "提交售后申请"),
	SUPPLY_EXAMINE_SUCCESS(AfterSaleStatusEnum.TO_BE_SUBMITTED_FOR_CHANNEL, "提交售后单到渠道"),
	CHANNEL_EXAMINE_AFTER_SALE(AfterSaleStatusEnum.TO_BE_REVIEWED_BY_CHANNEL, "待渠道审核售后单"),
	CHANNEL_EXAMINE_SUCCESS(AfterSaleStatusEnum.CHANNEL_AUDIT_SUCCESS, "渠道审核成功"),
	WAIT_REJECT_CONFIRM(AfterSaleStatusEnum.WAIT_REJECT_CONFIRM, "等待驳回确认"),
	BUSINESS_SENT_SUCCESS(AfterSaleStatusEnum.TO_BE_SENT_BACK_BY_BUYER, "等待业务退货"),
	CHANNEL_RETURN_SUCCESS(AfterSaleStatusEnum.TO_BE_CONFIRMED_BY_USER, "渠道确认售后单成功"),
	SYSTEM_CANCEL_RETURN_SUCCESS(AfterSaleStatusEnum.CLOSE, "系统自动取消"),
	WAIT_CHANNEL_RECEIVED(AfterSaleStatusEnum.PENDING_RECEIPT, "待渠道收货"),
	AFTER_SALE_COMPLETED(AfterSaleStatusEnum.COMPLETED, "售后完成"),
	FAIL(AfterSaleStatusEnum.FAIL, "售后失败"),
;
	@Getter
	private AfterSaleStatusEnum afterSaleStatusEnum;
	@Getter
	private String saleLogDesc;
	AfterSaleStateLogEnum(AfterSaleStatusEnum afterSaleStatusEnum, String saleLogDesc) {
		this.afterSaleStatusEnum = afterSaleStatusEnum;
		this.saleLogDesc = saleLogDesc;
	}

	public static String getSaleLogDescBySaleStatusEnum(AfterSaleStatusEnum afterSaleStatusEnum) {
		for (AfterSaleStateLogEnum saleStateLogEnum : AfterSaleStateLogEnum.values()) {
			if (EnumUtils.eq(saleStateLogEnum.getAfterSaleStatusEnum(),afterSaleStatusEnum.getValue())) {
				return saleStateLogEnum.getSaleLogDesc();
			}
		}
		return null;
	}
}
